﻿<%@ Page Title="Slabs" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="SlabStructure.aspx.cs" Inherits="FlexiPay.SlabStructure" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Label ID="lableTitle" runat="server" Text="Slab Structure" Font-Size="Medium"></asp:Label>
    <table border="1">
        <tr>
            <td rowspan="3" style="width: 20%;" align="left" valign="top">
                <asp:ListBox ID="LBSlabs" runat="server" Rows="25" Width="100%" DataSourceID="SDSSlabList"
                    DataTextField="SlabName" DataValueField="SlabId" OnDataBound="LBSlabs_DataBound"
                    OnSelectedIndexChanged="LBSlabs_SelectedIndexChanged" AutoPostBack="True"></asp:ListBox>
                <asp:SqlDataSource ID="SDSSlabList" runat="server" ConnectionString="<%$ ConnectionStrings:AgentBillingConnectionString %>"
                    SelectCommand="SELECT [SlabId], [SlabName] FROM [Slabs] WHERE [ToDate] > getDate() AND ProductName = @ProductName">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="'default'" Name="ProductName" Type="String" SessionField="ProductName" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td align="left" valign="top">
                <asp:Panel ID="PanelUpper" runat="server" Width="700px" Height="150px">
                    <table align="left" style="width: 700px">
                        <tr>
                            <td class="style4" valign="middle" width="90px">
                                <asp:Label ID="LabelName" runat="server" Text="Slab Name" Width="110px" Height="25px"></asp:Label>
                                <br />
                                <asp:Label ID="LabelDateFrom" runat="server" Text="Valid From" Width="110px"></asp:Label>
                            </td>
                            <td valign="middle">
                                <asp:TextBox ID="TextBoxName" runat="server" Width="270px"></asp:TextBox>
                                <br />
                                <asp:TextBox ID="TextBoxFrom" runat="server" Width="120px" onClick="return getDate('MainContent_TextBoxFrom');"></asp:TextBox>
                                <asp:Label ID="LabelDateTo" runat="server" Text="TO" Width="20px"></asp:Label>
                                <asp:TextBox ID="TextBoxTo" runat="server" Width="120px" onClick="return getDate('MainContent_TextBoxTo');"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style4" valign="middle">
                                <asp:Label ID="LabelRow" runat="server" Text=" Row Properties" Width="110px" Height="25px"></asp:Label>
                                <br />
                                <asp:Label ID="LabelColumn" runat="server" Text=" Column Properties" Width="110px"></asp:Label>
                            </td>
                            <td valign="middle">
                                <asp:Label ID="LabelRowCount" runat="server" Text="Count" Height="30px"></asp:Label>
                                <asp:DropDownList ID="DropDownList1" runat="server" Width="50px">
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                    <asp:ListItem>7</asp:ListItem>
                                    <asp:ListItem>8</asp:ListItem>
                                    <asp:ListItem>9</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;
                                <asp:Label ID="LabelRowRelOp" runat="server" Text="Operator"></asp:Label>
                                <asp:DropDownList ID="DropDownList2" runat="server" Width="50px">
                                    <asp:ListItem>&lt;</asp:ListItem>
                                    <asp:ListItem>&gt;</asp:ListItem>
                                    <asp:ListItem>&lt;=</asp:ListItem>
                                    <asp:ListItem>&gt;=</asp:ListItem>
                                    <asp:ListItem>=</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;
                                <asp:Label ID="LableFormulaR" runat="server" Text="Formula List" Width="75px"></asp:Label>
                                <asp:DropDownList ID="DDLFunctionR" runat="server" DataSourceID="DSFunctionListR"
                                    DataTextField="FormulaName" DataValueField="ID">
                                </asp:DropDownList>
                                <asp:SqlDataSource ID="DSFunctionListR" runat="server" ConnectionString="<%$ ConnectionStrings:AgentBillingConnectionString %>"
                                    SelectCommand="SELECT [ID], [FormulaName] FROM [FormulaTable] WHERE ([FormulaType] = @FormulaType) AND ([SubType] = @SubType) ORDER BY [FormulaName]">
                                    <SelectParameters>
                                        <asp:Parameter DefaultValue="Formula" Name="FormulaType" Type="String" />
                                        <asp:Parameter DefaultValue="Slab Structure" Name="SubType" Type="String" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <br />
                                <asp:Label ID="LabelColCount" runat="server" Height="30px" Text="Count"></asp:Label>
                                <asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList3_SelectedIndexChanged"
                                    Width="50px">
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                    <asp:ListItem>7</asp:ListItem>
                                    <asp:ListItem>8</asp:ListItem>
                                    <asp:ListItem>9</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;
                                <asp:Label ID="LabelColRelOp" runat="server" Text="Operator"></asp:Label>
                                <asp:DropDownList ID="DropDownList4" runat="server" Width="50px">
                                    <asp:ListItem>&lt;</asp:ListItem>
                                    <asp:ListItem>&gt;</asp:ListItem>
                                    <asp:ListItem>&lt;=</asp:ListItem>
                                    <asp:ListItem>&gt;=</asp:ListItem>
                                    <asp:ListItem>=</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;
                                <asp:Label ID="LableFormulaC" runat="server" Text="Formula List" Width="75px"></asp:Label>
                                <asp:DropDownList ID="DDLFunctionC" runat="server" DataSourceID="DSFunctionListC"
                                    DataTextField="FormulaName" DataValueField="ID">
                                </asp:DropDownList>
                                <asp:SqlDataSource ID="DSFunctionListC" runat="server" ConnectionString="<%$ ConnectionStrings:AgentBillingConnectionString %>"
                                    SelectCommand="SELECT [ID], [FormulaName] FROM [FormulaTable] WHERE ([FormulaType] = @FormulaType) AND ([SubType] = @SubType) ORDER BY [FormulaName]">
                                    <SelectParameters>
                                        <asp:Parameter DefaultValue="Formula" Name="FormulaType" Type="String" />
                                        <asp:Parameter DefaultValue="Slab Structure" Name="SubType" Type="String" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td class="style4">
                                <asp:Label ID="LabelStepped" runat="server" Text="Stepped/Tiered" Width="90px"></asp:Label>
                            </td>
                            <td class="style2" valign="middle">
                                &nbsp;
                                <asp:DropDownList ID="DropDownList5" runat="server">
                                    <asp:ListItem>Stepped</asp:ListItem>
                                    <asp:ListItem>Tiered</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;
                                <asp:Label ID="LabelStatus" runat="server" Text="Status" Width="50px" Height="30px"></asp:Label>
                                <asp:DropDownList ID="DDLStatus" runat="server" Height="20px" Width="90px">
                                    <asp:ListItem>Saved</asp:ListItem>
                                    <asp:ListItem>Submitted</asp:ListItem>
                                    <asp:ListItem>Approved</asp:ListItem>
                                    <asp:ListItem>Rejected</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                <asp:Panel ID="panelMiddleOuter" runat="server" Width="700px" ScrollBars="Both" Height="200px">
                    <asp:Panel ID="panelMiddleInner" runat="server" Width="2500px" Height="600px">
                        <asp:Table ID="PanelTable" runat="server">
                        </asp:Table>
                    </asp:Panel>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td align="center" valign="middle">
                <asp:Panel ID="PanelLower" runat="server" Width="700px" Height="30px">
                    <asp:Button ID="ButtonApply" runat="server" Height="30px" Text="Apply" Width="75px"
                        OnClick="ButtonApply_Click" OnClientClick="retrun Validation_Slab()" />
                    <asp:Button ID="ButtonEdit" runat="server" Height="30px" Text="Edit" Width="75px"
                        OnClick="ButtonEdit_Click" />
                    &nbsp;
                    <asp:Button ID="ButtonCancel" runat="server" Height="30px" Text="Cancel" Width="75px"
                        OnClick="ButtonCancel_Click" />
                    <asp:Button ID="ButtonCreate" runat="server" Height="30px" Text="Create New" Width="90px"
                        OnClick="ButtonCreate_Click" />
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
